<?php

$sql = " desc `{$param['schema']}`.`{$param['object']}` ";


$_data = $this->getData($sql);

$_temp_data = new DBData($this);
$_temp_data->setFields(
		array(
			'TABLE_NAME',
			'ORDINAL_POSITION',
			'COLUMN_NAME',
			'COLUMN_COMMENT', 
			'DATA_TYPE', 
			'COLUMN_TYPE', 
			'DATA_LENGTH',
			'DATA_PREC',
			'DATA_SCALE',
			'ISNULL',
			'OPTIONS', 
			'ISAUTO',
			'COLUMN_DEFAULT',
			'PK',
			'UQ',
			'C'
		)
);

while($_data->next()) { 
	$_temp_data->add(
		array(
			'TABLE_NAME'		=> $meta_info['object'],
			'ORDINAL_POSITION'	=> $_data->getIndex() + 1,
			'COLUMN_NAME'		=> $_data->field,
			'COLUMN_COMMENT'	=> '', 
			'DATA_TYPE'			=> $_data->type, 
			'COLUMN_TYPE'		=> $_data->type, 
			'DATA_LENGTH'		=> '',
			'DATA_PREC'			=> '',
			'DATA_SCALE'		=> '',
			'ISNULL'			=> ($_data->null == 'YES') ? 'NULL' : '',
			'OPTIONS'			=> $_data->extra, 
			'ISAUTO'			=> (trim(strtolower($_data->extra)) == 'auto_increment') ? 'Y' : 'N',
			'COLUMN_DEFAULT'	=> $_data->default,
			'PK'				=> ($_data->key == 'PRI') ? 'PK' : '',
			'UQ'				=> '',
			'C'					=> ''
		)	
	);

}

unset($_data);

return $_temp_data;

?>